package org.feiye.studyday21.prictice;

public class Cal {
	// 多个数乘法
	public long mul(int... a) {
		if (a.length == 0) {
			return 0L;
		}
		long mul = 1;
		for (int i = 0; i < a.length; i++) {
			mul *= a[i];
		}
		return mul;
	}

	public static void main(String[] args) {
		Cal c = new Cal();
		System.out.println(c.mul());// 值为1，不合理
		System.out.println(c.mul(7));
		System.out.println(c.mul(5, 1, 5));
	}
}
